package com.cans.dto;

import com.cans.model.pms.SysRoleGroup;

import java.io.Serializable;
import java.util.List;

/**
 * @author: cans
 * @date: 2018/5/1
 * @description: 角色组转换DTO
 */
public class RoleGroupTreeDTO implements Serializable {

    /**
     * ID
     */
    private String id;
    /**
     * 角色组名称
     */
    private String name;
    /**
     * 角色组编号
     */
    private String roleGroupCode;
    /**
     * 子集
     */
    private List<RoleGroupTreeDTO> children;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getRoleGroupCode() {
        return roleGroupCode;
    }

    public void setRoleGroupCode(String roleGroupCode) {
        this.roleGroupCode = roleGroupCode;
    }

    public List<RoleGroupTreeDTO> getChildren() {
        return children;
    }

    public void setChildren(List<RoleGroupTreeDTO> children) {
        this.children = children;
    }

    /**
     * 转换方法
     * @param roleGroup
     * @return
     */
    public RoleGroupTreeDTO transfer(SysRoleGroup roleGroup){

        this.id = roleGroup.getId();
        this.roleGroupCode = roleGroup.getRoleGroupCode();
        this.name = roleGroup.getRoleGroupName();

        return this;

    }
}
